package com.ruoyi.source.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.source.api.domain.SrcWorkRecord;
import com.ruoyi.source.mapper.SrcWorkRecordMapper;
import com.ruoyi.source.service.ISrcWorkRecordService;
import org.springframework.stereotype.Service;
/**
 * 工作记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-23
 */
@Service
public class SrcWorkRecordServiceImpl extends ServiceImpl<SrcWorkRecordMapper,SrcWorkRecord> implements ISrcWorkRecordService {
    /**
     * 查询工作记录
     * 
     * @param workId 工作记录主键
     * @return 工作记录
     */
    @Override
    public SrcWorkRecord selectSrcWorkRecordByWorkId(Long workId) {
        return baseMapper.selectSrcWorkRecordByWorkId(workId);
    }

    /**
     * 查询工作记录列表
     * 
     * @param srcWorkRecord 工作记录
     * @return 工作记录
     */
    @Override
    public List<SrcWorkRecord> selectSrcWorkRecordList(SrcWorkRecord srcWorkRecord) {
        return baseMapper.selectSrcWorkRecordList(srcWorkRecord);
    }

    /**
     * 新增工作记录
     * 
     * @param srcWorkRecord 工作记录
     * @return 结果
     */
    @Override
    public int insertSrcWorkRecord(SrcWorkRecord srcWorkRecord) {
        srcWorkRecord.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertSrcWorkRecord(srcWorkRecord);
    }

    /**
     * 修改工作记录
     * 
     * @param srcWorkRecord 工作记录
     * @return 结果
     */
    @Override
    public int updateSrcWorkRecord(SrcWorkRecord srcWorkRecord) {
        srcWorkRecord.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateSrcWorkRecord(srcWorkRecord);
    }

    /**
     * 批量删除工作记录
     * 
     * @param workIds 需要删除的工作记录主键
     * @return 结果
     */
    @Override
    public int deleteSrcWorkRecordByWorkIds(Long[] workIds) {
        return baseMapper.deleteSrcWorkRecordByWorkIds(workIds);
    }

    /**
     * 删除工作记录信息
     * 
     * @param workId 工作记录主键
     * @return 结果
     */
    @Override
    public int deleteSrcWorkRecordByWorkId(Long workId) {
        return baseMapper.deleteSrcWorkRecordByWorkId(workId);
    }
}
